#ifndef _ICHANNEL_H_
#define _ICHANNEL_H_

#define channel_status_open   1000
#define channel_status_close  2000
#define channel_send_complete 3000
#define channel_recv_complete 4000

interface IChannelProc : public IBase
{
    std_method(OnChannelOpen(int err, UINT addr) PURE;
    std_method(OnChannelClose(int err, int code) PURE;
    std_method(OnChannelEvent)(int err, int status, BYTE* data, ULONG len) PURE;
};

//{5f0f5c31-7c72-4c3a-b236-36dddd1b2908}
_DEF_IID(IID_IChannelProc, 0x5F0F5C31, 0x7C72, 0x4C3A, 0xB2, 0x36, 0x36, 0xDD, 0xDD, 0x1B, 0x29, 0x08);

interface IChannel : public IBase
{
    std_method(Open)(LPCSTR name, LPCSTR addr) PURE;
    std_method(Close)(UINT status) PURE;
    std_method(BindEvent)(LPCSTR name, IBase* pBase) PURE;
    std_method(UnBindEvent)(LPCSTR name) PURE;
};

//{35c00ef5-114f-4f66-b8cd-f8aa4c192445}
_DEF_IID(IID_IChannel, 0x35C00EF5, 0x114F, 0x4F66, 0xB8, 0xCD, 0xF8, 0xAA, 0x4C, 0x19, 0x24, 0x45);

interface IChannelFrame : public IBase
{
    std_method(CreateChannel)(LPCSTR name, IBase** pChannel) PURE;
};

//{d9e081af-6fa6-4445-9f44-3711b2ab1cec}
_DEF_CLSID(IID_IChannelFrame, 0xD9E081AF, 0x6FA6, 0x4445, 0x9F, 0x44, 0x37, 0x11, 0xB2, 0xAB, 0x1C, 0xEC)

//{46a65a7f-0e1c-4109-a319-a84be1def7f4}
_DEF_CLSID(CLSID_CChannelFrame, 0x46A65A7F, 0x0E1C, 0x4109, 0xA3, 0x19, 0xA8, 0x4B, 0xE1, 0xDE, 0xF7, 0xF4);

#endif
